/**
 * @file   loggerfile.h
 * @Author Alexandre Chassany (alexandre.chassany@gmail.com)
 * @date   February 2011
 * @brief  logger which log in a file
 *
 * Poum-tchak is a free sound manipulation and synthesis, 
 * real-time and interactive music-clip rendering.
 *
 * Copyright (C) 2011  Chassany Alexandre and Gonzalez Antoine.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * he Free Software Foundation, either version 3 of the License, or
 * at your option) any later version.
 *
 * is program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

#ifndef _ELIXIR_LOGGERFILE_H_
#define _ELIXIR_LOGGERFILE_H_

#include <core/ilogger.h>

#include <fstream>

namespace Elixir
{
  /**
   *@class LoggerFile
   *@brief A logger which output in a file.
   */
  
  class LoggerFile : public ILogger
  {
  public:
	/**
	 * @brief Default constructor
	 * @details This constructor create and open a file named
	 * output.txt where the program is executed for the moment.
	 * @todo expose the file name and path to the client ?
	 * @todo errors nedd to be handled
	 */
	LoggerFile();
	
	/**
	 * @brief Destructor.
	 * @details Close the file opened.
	 */
	virtual ~LoggerFile();
	
	/**
	 * @brief Interface implementation 
	 * @see Ilogger::write
	 */
	virtual void write(const std::string& msg);
	
  private:
	std::ofstream file_; //!< file where the msg are written
  };
}

#endif // _ELIXIR_LOGGERFILE_H_
